package cn.z2huo.algorithm.polynomial;

/**
 * 一元多项式中的一个项，系数用double类型，暂不考虑精度损失问题
 * 作者：张一卓
 * 日期：2020/10/1
 */
public class Item {
    /**
     * 下一个项
     */
    private Item next;

    /**
     * 系数
     */
    private double coefficient;

    /**
     * 指数
     */
    private int exponent;

    public Item() {
    }

    public double getCoefficient() {
        return coefficient;
    }

    public void setCoefficient(double coefficient) {
        this.coefficient = coefficient;
    }

    public int getExponent() {
        return exponent;
    }

    public void setExponent(int exponent) {
        this.exponent = exponent;
    }

    @Override
    public String toString() {
        return "Item{" +
                "coefficient=" + coefficient +
                ", exponent=" + exponent +
                '}';
    }

    public Item getNext() {
        return next;
    }

    public void setNext(Item next) {
        this.next = next;
    }
}
